home *** CD-ROM | disk | FTP | other *** search
/ PC Direct 1998 August / PC Direct August 1998.iso / S / powerj / Product / hpp.z / WOLEDISP.HPP < prev    next >
Encoding:
C/C++ Source or Header  |  1997-11-25  |  3.9 KB  |  122 lines

  1. /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2.    %     Copyright (C) 1996, by WATCOM International Inc.  All rights    %
  3.    %     reserved.  No part of this software may be reproduced or        %
  4.    %     used in any form or by any means - graphic, electronic or       %
  5.    %     mechanical, including photocopying, recording, taping or        %
  6.    %     information storage and retrieval systems - except with the     %
  7.    %     written permission of WATCOM International Inc.                 %
  8.    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  9. */
  10.  
  11. #ifndef _WOLEDISP_HPP_INCLUDED
  12. #define _WOLEDISP_HPP_INCLUDED
  13.  
  14. #ifndef _WNO_PRAGMA_PUSH
  15. #pragma pack(push,8);
  16. #pragma enum int;
  17. #endif
  18.  
  19. #ifndef _WOLETYPE_HPP_INCLUDED
  20. #  include "woletype.hpp"
  21. #endif
  22. #ifndef _WOLEIFAM_HPP_INCLUDED
  23. #  include "woleifam.hpp"
  24. #endif
  25.  
  26. struct WOleAutomationObjectRegistryDataBlock {
  27.     const WCLSID  *_typeLib;
  28.     WInt           _toolboxBitmap32;
  29. };
  30.  
  31. class WCMCLASS WOleAutomationObjectRegistryData : public WOleInterfaceFamilyRegistryData
  32. {
  33.     public:
  34.         WOleAutomationObjectRegistryData( const WCLSID & clsid, void * );
  35.         ~WOleAutomationObjectRegistryData( void );
  36.  
  37.         // Properties
  38.         WBool SetRegistryDataBlock( WOleAutomationObjectRegistryDataBlock * );
  39.         WOleAutomationObjectRegistryDataBlock *GetRegistryDataBlock( void ) const;
  40.  
  41.         // Self Registration
  42.         virtual WBool Register( WApplication *application );
  43.         virtual WBool Unregister( WApplication *application );
  44. };
  45.  
  46. #define WOleDefineAutomationObject( n, c, c_id, rdb ) \
  47.     static WOleAutomationObjectRegistryData n ## _WOleAutoRegistryData( c_id, &rdb );
  48.  
  49. /*************************************************************************
  50.  *
  51.  * WOleAutomationObject -- Ole Automation interface family
  52.  *
  53.  *   Events:
  54.  *
  55.  *************************************************************************/
  56.  
  57. class WOleISupportErrorInfo;
  58. class WOleIProvideClassInfo2;
  59.  
  60. class WCMCLASS WOleAutomationObject : public WOleInterfaceFamily
  61. {
  62.     WDeclareSubclass( WOleAutomationObject, WOleInterfaceFamily );
  63.  
  64.     public:
  65.  
  66.     /**********************************************************
  67.      * Constructors and Destructors
  68.      *********************************************************/
  69.         WOleAutomationObject( WOleServerObject *serverObject );
  70.         virtual ~WOleAutomationObject();
  71.  
  72.     /**************************************************************
  73.      * Properties
  74.      **************************************************************/
  75.  
  76.         // Dispatch Interface
  77.         WBool SetDispatchInterface( WPIDispatch dispatchInterface );
  78.         WPIDispatch GetDispatchInterface( void ) const;
  79.  
  80.         // IID
  81.         WBool SetIID( const WIID & guid );
  82.         WIID GetIID( void ) const;
  83.  
  84.         // IsIDispatch
  85.         WBool SetIsIDispatch( WBool );
  86.         WBool GetIsIDispatch( void );
  87.  
  88.     /**************************************************************
  89.      * Methods
  90.      **************************************************************/
  91.  
  92.         // overrides
  93.         virtual WBool Destroy( void );
  94.  
  95.         virtual WBool QueryInterface( const WCLSID & clsid, void **iface );
  96.  
  97.     /**********************************************************
  98.      * Operators
  99.      *********************************************************/
  100.  
  101.     /**********************************************************
  102.      * Data Members
  103.      *********************************************************/
  104.  
  105.     protected:
  106.         WBool                   _isIDispatch;
  107.         WPIDispatch             _dispatchInterface;
  108.         WOleISupportErrorInfo   *_iSuppErr;
  109.         WOleIProvideClassInfo2  *_pIProvideClassInfo2;
  110.         WIID                    _iid;
  111.  
  112. };
  113.  
  114.     
  115. #ifndef _WNO_PRAGMA_PUSH
  116. #pragma enum pop;
  117. #pragma pack(pop);
  118. #endif
  119.  
  120. #endif // _WOLEDISP_HPP_INCLUDED
  121.  
  122.